<template>
    <div id="NotFound">

        <h2>哎呀</h2>

        <h1 :style="{ backgroundImage: 'url(' + notFoundImg + ')' }">404</h1>

        <p>{{ randomAnswer() }}</p>

        <router-link :to="{name: 'home'}">回到首页</router-link>
    </div>
</template>

<script>
    export default {
        name: "NotFound",
        data() {
            return {
                notFoundImg: require('@/assets/images/404notfound.jpg'),
                randomAnswer: function () {
                    let answerList = [
                        '您要找的页面可能被外星人劫持了(＃°Д°)',
                        '您要找的页面可能飞到外星球了＞﹏＜',
                        '您要找的页面可能和您玩起了躲猫猫(～￣▽￣)～',
                        '您要找的页面可能去西天取经了(°ー°〃)',
                        '您要找的页面可能正在飞升渡劫(ง •_•)ง',
                        '您要找的页面可能被吃掉了〒▽〒',
                    ]

                    let randomNum = Math.floor(Math.random() * answerList.length)

                    return answerList[randomNum]
                }
            }
        }
    }
</script>

<style lang="scss" scoped>
    #NotFound {
        width: 100%;
        position: relative;
        padding: 200px 0;
        text-align: center;
        color: #343434;
        background-image: linear-gradient(125deg, #6a89cc, #b8e994);

        h1, h2, p {
            cursor: default;
            transition: 0.4s;
        }

        h2:hover, p:hover {
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
        }

        h1 {
            font-size: 160px;
            margin: 0;
            font-weight: 900;
            letter-spacing: 20px;
            background: center no-repeat;
            -webkit-text-fill-color: transparent;
            -webkit-background-clip: text;
        }

        p {
            font-size: 26px;
        }

        a {
            text-decoration: none;
            background: rgba(231, 81, 58, 0.67);
            color: #ffffff;
            padding: 12px 24px;
            display: inline-block;
            border-radius: 25px;
            font-size: 16px;
            text-transform: uppercase;
            transition: 0.4s;
        }
        a:hover {
            background: rgb(231, 81, 58);
            box-shadow: 0 2px 10px rgba(231, 81, 58, 0.5);
        }
    }
</style>
